package com.zzw.bean;

import java.util.Date;

public class EmailVerificationCode {
    
    private String email;
    private String code;
    private Date createTime;
    private Date expireTime;
    
    public EmailVerificationCode() {
    }
    
    public EmailVerificationCode(String email, String code, Date createTime, Date expireTime) {
        this.email = email;
        this.code = code;
        this.createTime = createTime;
        this.expireTime = expireTime;
    }
    
    public String getEmail() {
        return email;
    }
    
    public void setEmail(String email) {
        this.email = email;
    }
    
    public String getCode() {
        return code;
    }
    
    public void setCode(String code) {
        this.code = code;
    }
    
    public Date getCreateTime() {
        return createTime;
    }
    
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    
    public Date getExpireTime() {
        return expireTime;
    }
    
    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }
    
    public boolean isExpired() {
        return new Date().after(expireTime);
    }
    
    @Override
    public String toString() {
        return "EmailVerificationCode{" +
                "email='" + email + '\'' +
                ", code='" + code + '\'' +
                ", createTime=" + createTime +
                ", expireTime=" + expireTime +
                '}';
    }
} 